//存入用户信息
function saveLoginUser(user) {
    let loginUserJson = JSON.stringify(user);
    localStorage.setItem("login_user", loginUserJson);
}

//取出用户信息
function getLoginUser() {
    let sessionUserJson = localStorage.getItem("login_user");
    let sessionUser = JSON.parse(sessionUserJson);
    return sessionUser;
}

//删除用户信息
function removeLoginUser() {
    /*let sessionUserJson = localStorage.getItem("login_user");*/
    localStorage.clear();
    localStorage.removeItem("login_user");
}

//存入course信息
function saveCourse(course) {
    let courseClicked = JSON.stringify(course);
    console.log("courseClicked is : " + courseClicked);
    sessionStorage.removeItem("course");
    sessionStorage.setItem("course", courseClicked);
}

//读取course信息
function getCourse() {
    let sessionCourseJson = sessionStorage.getItem("course");
    let sessionCourse = JSON.parse(sessionCourseJson);
    return sessionCourse;
}




